package com.tledu.mapper;

import com.tledu.domain.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * @author cyrus
 */
@Mapper
public interface AccountMapper {
    @Update("update tb_account set money = money + ${money} where name = #{name}")
    void inMoney(@Param("name") String name, @Param("money") BigDecimal money);

    @Update("update tb_account set money = money - ${money} where name = #{name}")
    void outMoney(@Param("name") String name,@Param("money") BigDecimal money);
}
